package org.gienah.testing.junit;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * This class represents the common implementation of the
 * <code>IContextLoader</code> interface. Most clients will be fine using this
 * implementation.
 * 
 * @see org.gienah.testing.junit.IContextLoader
 * @see org.springframework.context.ConfigurableApplicationContext
 * @author Santiago L. Valdarrama
 * @since E0.1
 */
public class ContextLoader
		implements IContextLoader {

	/**
	 * Constructs a <code>ClassPathXmlApplicationContext</code> using the list
	 * of Spring configuration files provided.
	 * 
	 * @param locations The list of Spring configuration files.
	 * @return An instance of <code>ClassPathXmlApplicationContext</code>.
	 */
	public ConfigurableApplicationContext loadContext(final String[] locations) {
		return new ClassPathXmlApplicationContext(locations);
	}

}
